package com.loveprogrammer.battle.action;

import com.loveprogrammer.battle.Hero;

/**
 * @ClassName Attack
 * @Description TODO
 * @Author admin
 * @Date 2024/2/21 16:01
 * @Version 1.0
 */
public abstract class Attack implements Action{

    private int intervalTime;

    private int speed;

    public int getIntervalTime() {
        return intervalTime;
    }

    public void setIntervalTime(int intervalTime) {
        this.intervalTime = intervalTime;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    @Override
    public int intervalTime() {
        return intervalTime;
    }

    @Override
    public int speed() {
        return speed;
    }

    public int computeInterval(int speed) {
        return 500 + (int) (((1 - (speed) * 1.0 / (2000 + speed))
                * (1 - (speed) * 1.0 / (2000 + speed))) * 5000);
    }
}
